//
//  BaseTabBarViewController.m
//  yaome
//
//  Created by lanou on 15/12/17.
//  Copyright © 2015年 lanou. All rights reserved.
//

#import "BaseTabBarViewController.h"
#import "BaseNavigationViewController.h"
#import "MainTableViewController.h"
#import "ClassificationViewController.h"
#import "MapViewController.h"
#import "MyTableViewController.h"


@interface BaseTabBarViewController ()

 

@end

@implementation BaseTabBarViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    //添加子控制器
    MainTableViewController *main = [[MainTableViewController alloc] init];
    [self addChildViewController:main withName:@"首页"];
    
    ClassificationViewController *classification = [[ClassificationViewController alloc] init];
    [self addChildViewController:classification withName:@"分类"];
    
    MapViewController *map = [[MapViewController alloc] init];
    [self addChildViewController:map withName:@"附近"];
    
    MyTableViewController *my = [[MyTableViewController alloc] init];
    [self addChildViewController:my withName:@"我"];
    
    
}

- (void)addChildViewController:(UIViewController *)childController withName:(NSString *)name
{
    BaseNavigationViewController *bnvc = [[BaseNavigationViewController alloc] initWithRootViewController:childController];
    
    childController.title = name;
    
    [self addChildViewController:bnvc];
    
}

@end
